<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
		//让用户选择生日
		//循环生成select 中选项《option》
		//1990-2024
		//1-12
		//1-31
		
			
			
		</script>
		
			
		
		<h2>用户信息</h2>
		
		生日
		<script>
		window.onload = function() {
		    var birthDateSelect = document.getElementById('birthDateSelect');
		    var yearSelect = document.getElementById('yearSelect');
		    var monthSelect = document.getElementById('monthSelect');
		    var daySelect = document.getElementById('daySelect');
		 
		    // 生成年份选项
		    for (var i = new Date().getFullYear(); i >= 1900; i--) {
		        var opt = document.createElement('option');
		        opt.value = i;
		        opt.innerHTML = i;
		        yearSelect.appendChild(opt);
		    }
		 
		    // 生成月份选项
		    for (var i = 1; i <= 12; i++) {
		        var opt = document.createElement('option');
		        opt.value = i;
		        opt.innerHTML = i;
		        monthSelect.appendChild(opt);
		    }
		 
		    // 生成日期选项
		    for (var i = 1; i <= 31; i++) {
		        var opt = document.createElement('option');
		        opt.value = i;
		        opt.innerHTML = i;
		        daySelect.appendChild(opt);
		    }
		};
		</script>
		</head>
		<body>
		<form id="birthDateSelect" >
			  出生年份:
			    <select id="yearSelect"></select>
			    出生月份:
			    <select id="monthSelect"></select>
			    出生日期:
			    <select id="daySelect"></select>
		</form>
	
</html>
